import { ObjCreate } from "../../common/ObjCreate";
import { Language } from "../../../../../extend/language/Language";
import { GlobalClass } from "../../../../../com/mui/core/GlobalClass";
import { ImagesConst } from "../../../resource/ImagesConst";
import { BaseItem } from "../../common/BaseItem";
import { ItemData } from "../../../resource/info/ItemData";
import { HTMLUtil } from "../../../../../com/gengine/utils/HTMLUtil";
import { ColorConfig } from "../../../resource/ColorConfig";
import { ItemsUtil } from "../../shortcuts/item/ItemsUtil";
import { GLabel } from "../../../../../com/mui/controls/GLabel";
//class AdvanceEquipPanel
    
    export  class AdvanceEquipPanel /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            ObjCreate.createBg(0, 0, 202, 102, this);
            this._label = ObjCreate.createLabel(Language.getString(60271), 5, 5, 180, 20, flash.text.TextFormatAlign.LEFT, this, true, 16702014);
            this.itembg = GlobalClass.getBitmap(ImagesConst.equipment_boarder);
            this.itembg.x = 78;
            this.itembg.y = 25;
            this.itembg.visible = false;
            this.addChild(this.itembg);
            this.item = new BaseItem();
            this.item.toolTipType = ItemData.ToolTipType_Forge;
            this.item.setSize(32, 32);
            this.item.isDragAble = false;
            this.item.isDropAble = false;
            this.item.isThrowAble = false;
            this.item.isShowLock = true;
            this.item.x = this.itembg.x + 8;
            this.item.y = this.itembg.y + 8;
            addChild(this.item);
            this.descLabel = ObjCreate.createLabel("", 0, 75, 202, 20, flash.text.TextFormatAlign.CENTER, this, true, 11726847);
            return;
        }

        public set label(arg1: string)
        {
            this._label.htmlText = HTMLUtil.addColor(arg1, "#FEDA3E");
            return;
        }

        public setEquip(arg1: ItemData): void
        {
            var loc1=null;
            if (arg1) 
            {
                this.itembg.visible = true;
                this.item.itemData = arg1;
                loc1 = ColorConfig.instance.getItemColor(arg1.itemInfo.item.color);
                this.descLabel.htmlText = Language.getString(60272) + ItemsUtil.getItemName(arg1);
            }
            else 
            {
                this.itembg.visible = false;
                this.item.itemData = null;
                this.descLabel.htmlText = "";
            }
            return;
        }

        public getEquip(): ItemData
        {
            return this.item.itemData;
        }

        /* internal */ /* var */itembg: Object /* flash.display.Bitmap */;

        /* internal */ /* var */item: BaseItem;

        /* internal */ /* var */descLabel: GLabel;

        /* internal */ /* var */_label: GLabel;
    }
